void main() {
  Map person = {'name': '张胜男', 'age': 23};
  print(person);
  // 构造函数
  Map p = new Map();
  p['name'] = '转岗';
  p['age'] = 35;
  print(p);

  print(p['name']);

  print(p.containsKey('name'));
  print(p.containsKey('sex'));

  // 如果key不存在，赋值，存在不赋值
  p.putIfAbsent('gender', () => '男');
  p.putIfAbsent('gender', () => '女');
  print(p);

  print(p.keys);
  print(p.values);

  // 根据条件进行删除
  p.removeWhere((key, value) => key == 'gender');
  print(p);
}
